/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogComparatives.java
 *
 * Created on 02/06/2011, 19:15:31
 */

package systole.view.crud.comparatives;

/**
 *
 * @author jmj
 */
public class JDialogComparatives extends javax.swing.JDialog {

    private ControllerComparativeEdition controller;

    /** Creates new form JDialogComparatives
     * @param parent
     * @param controller
     */
    public JDialogComparatives(java.awt.Frame parent,ControllerComparativeEdition controller) {
        super(parent, true);
        initComponents();
        this.controller = controller;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPnlCenter = new javax.swing.JPanel();
        jLblName = new javax.swing.JLabel();
        jLblObservation = new javax.swing.JLabel();
        jTxtName = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTxtObservation = new javax.swing.JTextArea();
        jPnlButtoms = new javax.swing.JPanel();
        jBtnOk = new javax.swing.JButton();
        jBtnCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setModal(true);
        setName("Form"); // NOI18N
        setResizable(false);

        jPnlCenter.setName("jPnlCenter"); // NOI18N
        jPnlCenter.setPreferredSize(new java.awt.Dimension(457, 150));

        jLblName.setFont(jLblName.getFont().deriveFont(jLblName.getFont().getStyle() | java.awt.Font.BOLD));
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getResourceMap(JDialogComparatives.class);
        jLblName.setText(resourceMap.getString("jLblName.text")); // NOI18N
        jLblName.setName("jLblName"); // NOI18N

        jLblObservation.setFont(jLblObservation.getFont().deriveFont(jLblObservation.getFont().getStyle() | java.awt.Font.BOLD));
        jLblObservation.setText(resourceMap.getString("jLblObservation.text")); // NOI18N
        jLblObservation.setName("jLblObservation"); // NOI18N

        jTxtName.setText(resourceMap.getString("jTxtName.text")); // NOI18N
        jTxtName.setToolTipText(resourceMap.getString("jTxtName.toolTipText")); // NOI18N
        jTxtName.setName("jTxtName"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTxtObservation.setColumns(20);
        jTxtObservation.setFont(jTxtObservation.getFont());
        jTxtObservation.setLineWrap(true);
        jTxtObservation.setRows(5);
        jTxtObservation.setToolTipText(resourceMap.getString("jTxtObservation.toolTipText")); // NOI18N
        jTxtObservation.setWrapStyleWord(true);
        jTxtObservation.setName("jTxtObservation"); // NOI18N
        jScrollPane1.setViewportView(jTxtObservation);

        javax.swing.GroupLayout jPnlCenterLayout = new javax.swing.GroupLayout(jPnlCenter);
        jPnlCenter.setLayout(jPnlCenterLayout);
        jPnlCenterLayout.setHorizontalGroup(
            jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlCenterLayout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblObservation)
                    .addComponent(jLblName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                    .addComponent(jTxtName, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE))
                .addGap(20, 20, 20))
        );
        jPnlCenterLayout.setVerticalGroup(
            jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlCenterLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTxtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLblObservation)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(19, Short.MAX_VALUE))
        );

        getContentPane().add(jPnlCenter, java.awt.BorderLayout.CENTER);

        jPnlButtoms.setName("jPnlButtoms"); // NOI18N
        jPnlButtoms.setPreferredSize(new java.awt.Dimension(380, 40));

        jBtnOk.setText(resourceMap.getString("jBtnOk.text")); // NOI18N
        jBtnOk.setName("jBtnOk"); // NOI18N
        jBtnOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnOkActionPerformed(evt);
            }
        });
        jPnlButtoms.add(jBtnOk);

        jBtnCancel.setText(resourceMap.getString("jBtnCancel.text")); // NOI18N
        jBtnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCancelActionPerformed(evt);
            }
        });
        jPnlButtoms.add(jBtnCancel);

        getContentPane().add(jPnlButtoms, java.awt.BorderLayout.SOUTH);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBtnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnOkActionPerformed
        this.controller.ok();
    }//GEN-LAST:event_jBtnOkActionPerformed

    private void jBtnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCancelActionPerformed
      this.controller.cancel();
    }//GEN-LAST:event_jBtnCancelActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtnCancel;
    private javax.swing.JButton jBtnOk;
    private javax.swing.JLabel jLblName;
    private javax.swing.JLabel jLblObservation;
    private javax.swing.JPanel jPnlButtoms;
    private javax.swing.JPanel jPnlCenter;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTxtName;
    private javax.swing.JTextArea jTxtObservation;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the jTxtName
     */
    public javax.swing.JTextField getjTxtName() {
        return jTxtName;
    }

    /**
     * @return the jTxtObservation
     */
    public javax.swing.JTextArea getjTxtObservation() {
        return jTxtObservation;
    }
    


}
